/**
 * @Project Name:cn.hoofungson.studio
 * @Package Name:cn.hoofungson.sso.util
 * @Since JDK 1.8
 */
package cn.hoofungson.sso.util;

import cn.hoofungson.sso.model.User;
import com.alibaba.fastjson.JSONObject;

/**
 * @Description: Jwt工具
 * @Author 胡松 hoofungson@163.com
 * @Date 2017-11-10 21:06
 * @Version V1.0
 */
public class JwtUtil {

    /**
     * 生成subject信息
     * @param user
     * @return
     */
    public static String generalSubject(User user){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("userId", user.getId());
        jsonObject.put("roleId", user.getRoleId());
        return jsonObject.toJSONString();
    }
}
